<template>
	
	<view class="tabHeader">
		<image src="../../static/tabBar/搜索，猫客.png"></image>
		<image class="msgImg" src="../../static/tabBar/211铃铛-线性.png"></image>
		<image v-if="avatarUrl" class="avatar" :src="avatarUrl" @click="toCenter"></image>
		<image v-else class="avatar" src="../../static/tabBar/avatar.png" @click="toLogin"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods:{
			toLogin(){
				wx.navigateTo({
					url:'/pages/login/login'
				})
			},
			// 转跳到个人中心页面
			toCenter(){
				uni.navigateTo({
					url:'/pages/center/center'
				})
			}
		},
		computed:{
			avatarUrl(){
				return uni.getStorageSync('userInfo_key').avatarUrl
			}
			
		}

	}
</script>

<style lang="stylus">
.tabHeader
	margin 0 32rpx
	display inline-flex
	width 216rpx
	height 104rpx
	align-items center
	justify-content space-between
	float right	
	image
		width 50rpx
		height 50rpx
		border-radius 50%

</style>
